//写入文件
#include<stdio.h>
int main(int argc,const char*argv[]){
    char buff[255];
    FILE *fp = fopen("D:/tmp/test.txt","w+");
    fprintf(fp,"This is testing for fprintf……\n");
    fputs("This is testing for fputs\n",fp);
    fclose(fp);
    if(fp){
        int num;
        fscanf(fp,"%d",&num);
        printf("%d\n",num);
        fclose(fp);
    }else{
        printf("无法打开文件\n");
    }
    return 0;
}